package com.lebang.feign.bus;

import com.lebang.feign.bus.fallback.BusRecordFallback;
import com.lebang.model.RequestUserInfo;
import com.lebangweb.response.JsonData;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author ljx
 */
@FeignClient(name = "wangzhuan-bus", contextId = "wangzhuan-bus-record", fallback = BusRecordFallback.class)
public interface BusRecordFeign {

    /**
     * 添加当前城市用户搜索公交线路记录
     * @return
     */
    @ApiOperation("添加当前城市用户搜索公交线路记录")
    @PostMapping("/buss/record/add")
    JsonData add(@RequestBody RequestUserInfo request,
                 @RequestParam("cityId") String cityId,
                 @RequestParam("route") String route,
                 @RequestParam("routeId") String routeId,
                 @RequestParam("endStan") String endStan,
                 @RequestParam("routeNum") String routeNum
    );

    /**
     * 查询当前城市用户搜索公交线路记录
     * @return
     */
    @ApiOperation("查询当前城市用户搜索公交线路记录")
    @PostMapping("/buss/record/get")
    JsonData get(@RequestBody RequestUserInfo requestUserInfo, @RequestParam(value = "cityId") String cityId);


    /**
     * 删除当前城市用户搜索公交线路记录
     * @return
     */
    @ApiOperation("删除当前城市用户搜索公交线路记录")
    @PostMapping("/buss/record/del")
    JsonData del(@RequestBody RequestUserInfo requestUserInfo, @RequestParam(value = "cityId") String cityId,@RequestParam(value = "routeId",required = false) String routeId);
}
